home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 7_10.lha / 7_10 / po_error.c < prev    next >
Text File  |  1993-08-08  |  541b  |  30 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include <process.h>
  6. include <debug.h>    /* DELETE */
  7. / print an error message and exit
  8. / or invoke the user-defined error function
  9. oid process_object::error(char *s)
  10.  
  11.    static int in_error_fct = 0;
  12.  
  13.    // recursive errors aren't allowed
  14.    if (in_error_fct)
  15. ::exit(1);
  16.  
  17.    in_error_fct = 1;
  18.  
  19.    if (po_error_fct)
  20. (*po_error_fct)(s);
  21.  
  22.    else
  23. {
  24. cerr << s << "\n";
  25. ::exit(1);
  26. }
  27.  
  28.    in_error_fct = 0;
  29.  
  30.